//
//  TimedEvent.swift
//  Utility
//
//  Created by 何海涛 on 2017/5/24.
//  Copyright © 2017年 何海涛. All rights reserved.
//

import Foundation

// 2016.8.16 泛型类在iOS7内存在BUG, 先改为弱类型引用
// class WeakReferenceWrapper<T: protocol<AnyObject,Equatable,Hashable>> : NSObject {
//      private weak var reference: T?
public class WeakReferenceWrapper : NSObject {
    fileprivate weak var rawReference : AnyObject?
    public func refer<T>() -> T? { return rawReference as? T }
    public var isNull : Bool { return rawReference == nil }
    
    public init(refer: AnyObject?) {
        rawReference = refer
    }
}
